package lab02.test04;

public class HourSalary extends Staff{
    private double salaryIncrease;
    private int hour;

    public HourSalary(String name, String num, double baseSalary, int hour) {
        super(name, num, baseSalary);
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }


    //根据员工工作时长来计算工资
    public double getSalaryIncrease(int hour) {
        if (hour<=150){
            return 0;    //时长小于150时不计额外工资
        }else{

            //超过150的时间按每小时10元计算额外工资
            salaryIncrease= (hour-150)*10;

        }
        return salaryIncrease;

    }

    public void setSalaryIncrease(double salaryIncrease) {
        this.salaryIncrease = salaryIncrease;
    }


}
